<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 
      /*
    * @description: 一个类似边框旋转的动画效果
    * @fileName: index.html 
    * @author: DangPeng
    * @date: 2024-02-23 11:34:44 
   */
   -->
    <div class="box">江山易改,本性难移</div>
    <style>
        body {
            background-color: #2e2b2b;
        }

        .box {
            width: 300px;
            height: 100px;
            background-color: #000;
            border-radius: 10px;
            line-height: 100px;
            text-align: center;
            color: #fff;
            font-size: 20px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            /* 文字间距 */
            letter-spacing: 10px;
            /* 文字阴影 */
            /* text-shadow: -1px 1px #bb2288,
        -2px 2px #0f0,
        -3px 3px #f00; */
            /* 文字描边 */
            -webkit-text-stroke: 0.2px #0f0;
            overflow: hidden;
        }

        .box::before {
            content: '';
            display: block;
            width: 100%;
            height: 300%;
            background-color: #03e9f4;
            position: absolute;
            top: 50%;
            left: 50%;
            z-index: -2;
            /* transform: translate(-50%, -50%); */
            animation: rotateBox 2s linear infinite;
            transform-origin: left top;

        }

        @keyframes rotateBox {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(1turn);
            }

        }


        .box::after {
            content: '';
            display: block;
            width: calc(100% - 4px);
            height: calc(100% - 4px);
            border-radius: 10px;
            margin: 2px;
            background-color: rgb(0, 0, 0);
            position: absolute;
            top: 0;
            left: 0;
            z-index: -1;
        }
    </style>
</body>

</html>